home *** CD-ROM | disk | FTP | other *** search
- package symantec.itools.db.awt;
-
- import java.awt.Button;
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Event;
- import java.awt.Frame;
- import java.awt.Label;
- import java.awt.LayoutManager;
- import java.awt.TextField;
- import symantec.itools.db.pro.ConnectionInfo;
- import symantec.itools.db.pro.Logon;
-
- public class LogonFrame extends Frame implements Logon {
- // $FF: renamed from: OK java.awt.Button
- Button field_0;
- Button Cancel;
- TextField UserNameEdit;
- TextField UserPasswordEdit;
- Label label3;
- Label label4;
- Label datasource;
- Label datasource1;
- ConnectionInfo m_ConnectionInfo;
- boolean m_Action;
-
- public LogonFrame() {
- super("LogonFrame window");
- ((Container)this).setLayout((LayoutManager)null);
- ((Frame)this).addNotify();
- ((Component)this).resize(((Container)this).insets().left + ((Container)this).insets().right + 501, ((Container)this).insets().top + ((Container)this).insets().bottom + 219);
- this.field_0 = new Button("OK");
- ((Container)this).add(this.field_0);
- this.field_0.reshape(((Container)this).insets().left + 385, ((Container)this).insets().top + 7, 91, 30);
- this.Cancel = new Button("Cancel");
- ((Container)this).add(this.Cancel);
- this.Cancel.reshape(((Container)this).insets().left + 385, ((Container)this).insets().top + 45, 91, 30);
- this.UserNameEdit = new symantec.itools.db.awt.TextField(28);
- ((Container)this).add(this.UserNameEdit);
- this.UserNameEdit.reshape(((Container)this).insets().left + 133, ((Container)this).insets().top + 112, 238, 23);
- this.UserPasswordEdit = new symantec.itools.db.awt.TextField(28);
- this.UserPasswordEdit.setEchoCharacter('*');
- ((Container)this).add(this.UserPasswordEdit);
- this.UserPasswordEdit.reshape(((Container)this).insets().left + 133, ((Container)this).insets().top + 150, 238, 22);
- this.label3 = new Label("UserName");
- ((Container)this).add(this.label3);
- this.label3.reshape(((Container)this).insets().left + 14, ((Container)this).insets().top + 120, 70, 15);
- this.label4 = new Label("Password");
- ((Container)this).add(this.label4);
- this.label4.reshape(((Container)this).insets().left + 14, ((Container)this).insets().top + 157, 70, 15);
- this.datasource = new Label("DataSource Name:");
- ((Container)this).add(this.datasource);
- this.datasource.reshape(((Container)this).insets().left + 14, ((Container)this).insets().top + 15, 133, 15);
- this.datasource1 = new Label("DataSource Name:");
- ((Container)this).add(this.datasource1);
- this.datasource1.reshape(((Container)this).insets().left + 140, ((Container)this).insets().top + 15, 224, 15);
- }
-
- public void show() {
- super.show();
- }
-
- public boolean handleEvent(Event event) {
- if (event.id == 1001 && event.target == this.Cancel) {
- this.clickedCancel();
- return true;
- } else if (event.id == 1001 && event.target == this.field_0) {
- this.clickedOK();
- return true;
- } else if (event.id == 201) {
- ((Component)this).hide();
- return true;
- } else {
- if (event.id == 401 && event.key == 9) {
- if (event.target == this.UserNameEdit) {
- this.UserPasswordEdit.requestFocus();
- } else {
- this.UserNameEdit.requestFocus();
- }
- }
-
- return super.handleEvent(event);
- }
- }
-
- public void clickedOK() {
- this.m_ConnectionInfo.setUser(this.UserNameEdit.getText());
- this.m_ConnectionInfo.setPassword(this.UserPasswordEdit.getText());
- this.m_Action = true;
- ((Component)this).hide();
- }
-
- public void clickedCancel() {
- this.m_Action = false;
- ((Component)this).hide();
- }
-
- public boolean logonFailed(ConnectionInfo conn, int retries) {
- this.m_ConnectionInfo = conn;
- this.UserNameEdit.setText(conn.getUser());
- this.UserPasswordEdit.setText(conn.getPassword());
- this.datasource1.setText(conn.getDBString());
- ((Frame)this).setTitle("User Authentication");
- this.show();
-
- while(((Component)this).isVisible()) {
- Thread.currentThread();
- Thread.yield();
- }
-
- conn = this.m_ConnectionInfo;
- return this.m_Action;
- }
- }
-